// CopyableMap.h: interface for the CCopyableMap class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_COPYABLEMAP_H__405F3892_B4A0_476E_8181_AE89A1A78EA2__INCLUDED_)
#define AFX_COPYABLEMAP_H__405F3892_B4A0_476E_8181_AE89A1A78EA2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>

template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
class CCopyableMap : public CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>
{
public:
	const CCopyableMap<KEY,ARG_KEY,VALUE,ARG_VALUE>& operator = (const CCopyableMap<KEY,ARG_KEY,VALUE,ARG_VALUE> & map)
	{
		if (FALSE == IsEmpty())
			RemoveAll();
		POSITION pos= map.GetStartPosition();
		while (pos)
		{
			KEY rKey;
			VALUE rValue;
			map.GetNextAssoc( pos, rKey, rValue );
			SetAt( rKey, rValue );
		}
	return (*this);
	}
};

#endif // !defined(AFX_COPYABLEMAP_H__405F3892_B4A0_476E_8181_AE89A1A78EA2__INCLUDED_)
